package com.tsit.study.netty;

import com.tsit.study.netty.client.NettyClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * @author wangxuzhi
 * @date 2020/11/24 15:30
 */
@SpringBootApplication
public class NettyClientApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(NettyClientApplication.class, args);
    }

    @Autowired
    private NettyClient nettyClient;

    @Override
    public void run(String... args) throws Exception {
        new Thread(() -> {
            nettyClient.start();
        }).start();
    }
}
